package com.wing.cabinet.service;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.wing.cabinet.model.entity.StorageInventorySpace;
import com.wing.cabinet.model.request.StorageInventorySpaceForm;
import com.wing.cabinet.model.request.UseInventoryInoutDetailForm;
import com.wing.cabinet.model.response.CabOptimalSpaces;
import com.wing.cabinet.model.response.StorageInventorySpaceVO;

import java.util.List;
import java.util.Map;

/**
 * 暂存柜产品货道库存-Service
 *
 * @author
 */
public interface StorageInventorySpaceService extends IService<StorageInventorySpace> {

    /**
     * 添加
     *
     * @param storageInventorySpaceForm
     * @return
     */
    int add(StorageInventorySpaceForm storageInventorySpaceForm);

    /**
     * 列表-app
     *
     * @param params
     *
     * @return
     */
    List<StorageInventorySpaceVO> list4app(Map<String, Object> params);

    /**
     * 分页list-app
     *
     * @param page
     * @param params
     *
     * @return
     */
    Page<StorageInventorySpaceVO> pageList4app(Page page, Map<String, Object> params);

    Page<StorageInventorySpaceVO> pageList(Page page, Map<String, Object> params);

    Page<StorageInventorySpaceVO> storageInventorySpaceList(Page page, Map<String, Object> params);

    Page<StorageInventorySpaceVO> detasPageList(Page page, Map<String, Object> params);

    /**
     * 详情-app
     *
     * @param id
     *
     * @return
     */
    StorageInventorySpaceVO get4appById(Long id);

    /**
     * 库存列表导出
     * @param params
     * @return
     */
    List<StorageInventorySpaceVO> ecxportList(Map<String, Object> params);

    List<CabOptimalSpaces> getCabOptimalSpaces(UseInventoryInoutDetailForm useInventoryInoutDetailForm);

    List<CabOptimalSpaces> getCabOptimalCargoSpaces(UseInventoryInoutDetailForm useInventoryInoutDetailForm);

    void getOptimalSpaces(UseInventoryInoutDetailForm useInventoryInoutDetailForm);

    List<CabOptimalSpaces> sortSpaces(List<UseInventoryInoutDetailForm> skuLaneList);

    /**
     * 根据条件查询统计库存数
     * @param mainCabCode
     * @param cabCode
     * @param skuCode
     * @return
     */
    Integer getSumByParams(String mainCabCode, String cabCode, String skuCode);

}
